package com.zmj.security;

import com.zmj.security.model.UserSubject;

import javax.servlet.http.HttpServletRequest;
import java.util.function.Function;

/**
 * @Author: zmj
 * @Date: 2025/1/14
 */
public class TokenAuthenticator implements Authenticator {

    private Function<HttpServletRequest, UserSubject> authenticator;

    @Override
    public boolean support(HttpServletRequest request) {
        return true;
    }

    @Override
    public UserSubject authenticate(HttpServletRequest request) {
        return authenticator.apply(request);
    }

}
